<!DOCTYPE HTML>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="__UI__/css/bs3/dpl.css" rel="stylesheet">
<link href="__UI__/css/bs3/bui.css" rel="stylesheet">
<link href="__UI__/css/page.css" rel="stylesheet" type="text/css" />
</head>
<body> 
<div class="container">
	<div class="search-grid-container">
		<div id="grid"></div>
        <div id="bar"></div>
	</div>
</div>
<script type="text/javascript" src="__UI__/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="__UI__/js/bui.js"></script>
<script type="text/javascript" src="__UI__/js/config.js"></script>
<script type="text/javascript">
	//top.topManager.closePage('manage');
	BUI.use('common/page');
	BUI.use(['common/search','bui/overlay'],function (Search,Overlay){
		var columns = [
			{title:'演练名称',dataIndex:'title',width:100},
			{title:'操作',dataIndex:'',width:100,renderer:function(value,obj){
				var recordStr = Search.createLink({
					id:'contents' + obj.id,
					title:'查看记录',
					text:'查看&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
					href:'{:U("Home/Records/content/id/' + obj.id + '")}',
					isClose:true,
				});
				buildStr = Search.createLink({
					id:'build' + obj.id,
					title:'生成记录',
					text:'生成',
					href:'{:U("Home/Records/build/id/' + obj.id + '")}',
					isClose:true,
				});
				return recordStr + buildStr;
			}},
		],
		
		store = Search.createStore('{:U("Records/index", array("id"=>I("get.id")))}',{
			proxy:{
				save:{removeUrl:'{:U("Records/index", array("id"=>I("get.id")))}'}
			},
			autoSync:true,
			pageSize:10,
		}),
		
		gridCfg = Search.createGridCfg(columns,{
			forceFit:true,
			tbar:{
				items:[
					{text : '<i class="icon-refresh"></i>刷新页面',btnCls : 'button button-small',handler:function(){
						window.location.reload();
					}},
				]
			},
			plugins:[BUI.Grid.Plugins.CheckSelection,BUI.Grid.Plugins.RowNumber] 
		});
		
		var  search = new Search({
			store:store,
			gridCfg:gridCfg,
		}),
		
		grid = search.get('grid');
		
	});
</script>
</body>
</html>
